<?xml version="1.0" encoding="UTF-8"?>
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:f="http://xmlns.jcp.org/jsf/core"
	xmlns:h="http://xmlns.jcp.org/jsf/html"
	xmlns:p="http://primefaces.org/ui"
	xmlns:ui="http://java.sun.com/jsf/facelets">

<f:view>
 <h:head>
        <title>Ventes Privées</title>
</h:head>
<h:body>
	
	<ui:include src="header.xhtml" />
	
	<h3>Mon Panier</h3>

			<h:link value="retour aux ventes privées" outcome="liste_ventesprivees"/>
		<h:form>  
			
			<h:messages errorClass="error" />
		
		    <p:dataTable var="monArticlePanier" value="#{panierCtrl.allArticlePanier}" id="panelPanier">
		        <p:column headerText="Libellé article" style="text-align:center"  >  
		            <h:outputText value="#{monArticlePanier.libelleArticle}"/>   
		        </p:column>  
		  
		        <p:column headerText="Taille" style="text-align:center">  
		            <h:outputText value="#{monArticlePanier.tailleChoisie.taille}"  />
		        </p:column>  
		
		        <p:column headerText="Couleur" style="text-align:center">  
		            <h:outputText value="#{monArticlePanier.couleurChoisie.couleur}" />  
		        </p:column>  
		
				<p:column headerText="Quantité" style="text-align:center">
					<p:spinner id="quantite"
						value="#{monArticlePanier.quantiteDesiree}" min="1" max="100" size="1">
						<p:ajax  update="ajaxprixarticle" process="@this"  />
						<p:ajax  update="panelPanier" process="panelPanier" />
					</p:spinner>
				</p:column>
		            
		
		        <p:column headerText="Prix" style="text-align:center">
		            <h:outputText id="ajaxprixarticle" value="#{monArticlePanier.prixTotalArticlePanier}" />  
		        </p:column>  
		
		        <p:column headerText="Supprimer" style="text-align:center">  
	            <p:commandButton value="Supprimer" actionListener="#{panierCtrl.actionSupprimer(monArticlePanier)}" ajax="false" />   
		        </p:column>
		        
		        <div id="panelFooter">
	            <p:columnGroup type="footer">  
		            <p:row>  
		                <p:column colspan="4" footerText="Total "  
		                                style="text-align:right"  />  
		  
		                <p:column id="ajaxprixpanier" footerText="#{panierCtrl.panier.prix} €"   />  
		                <p:column />  
		            </p:row>  
        		</p:columnGroup>  
        		</div>
		        
		    </p:dataTable>  
			<br></br>		    
	            <p:commandButton style="float:right;" value="Passer commande" action="commande" />   

			<br/>
		</h:form>  
	
	<p:dialog id="basicDialog" header="Panier" widgetVar="dlg1">  
    //<h:outputText value="Fonction 'Supprimer' non encore implémentée" />  
	</p:dialog>  
</h:body>
</f:view>
</html>